using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

public class ReadData
{
    public static LinkedList<Realm> ReadRealmData()
    {
        // 读取境界数据
        if (!File.Exists(Constant.REALM_DATA_PATH))
            return new LinkedList<Realm>();

        using FileStream stream = new FileStream(Constant.REALM_DATA_PATH, FileMode.Open);
        BinaryFormatter formatter = new BinaryFormatter();
        return (LinkedList<Realm>)formatter.Deserialize(stream);
    }
}